Skip to content

Conversation

@mtjhrc
Copy link
Owner

@mtjhrc mtjhrc commented Jan 30, 2024

No description provided.

@mtjhrc mtjhrc force-pushed the multiport-console-v3 branch 8 times, most recently from 26a295d to 938aae9 Compare January 30, 2024 17:32
Signed-off-by: Matej Hrica <[email protected]>
This makes the device act as a multiport console.
This doesn't introduce new functionality, the number of ports remains
fixed at 1 port (for the terminal with stdin/stdout).

Signed-off-by: Matej Hrica <[email protected]>
@mtjhrc mtjhrc force-pushed the multiport-console-v3 branch from 938aae9 to 38ffaed Compare January 30, 2024 17:40
@mtjhrc mtjhrc force-pushed the multiport-console-v3 branch 3 times, most recently from 12c8689 to 630c0cd Compare January 31, 2024 11:39
This is done by creating a port for each of stdin/stdout/stderr,
Each of these ports is multidirectional but we only use one direction.
Port 0 must always be a console - this is implied by the specification.

Signed-off-by: Matej Hrica <[email protected]>
@mtjhrc mtjhrc force-pushed the multiport-console-v3 branch 2 times, most recently from 1cbe806 to c14f41f Compare January 31, 2024 19:46
When we redirect the stdout of the guest it opens the question,
where should init/kernel messages (things written to the console) go.
It seems to make sense to write it as errors to the log,
because for now the only messages that go there are errors.

Signed-off-by: Matej Hrica <[email protected]>
This works by writing ascii 'ETX' into the guest console on SIGINT.
This curently only works when the guest input is redirected (otherwise
pressing ^C should work, but SIGINT to the host libkrun process
won't work.

Furthermore init process needs to fork itself, because pid 1
cannot receive SIGINT signal, unless it instals a handler, but we cannot
expect all programs to do that.

Signed-off-by: Matej Hrica <[email protected]>
We should wait until the output currently in the queue of the guest
is written and only then exit the libkrun process.

This fixes an issue where you would sometimes not get the full output
of a program inside the vm (we would call exit sooner, than we
finished all the writes).

Signed-off-by: Matej Hrica <[email protected]>
@mtjhrc mtjhrc force-pushed the multiport-console-v3 branch from c14f41f to e0bccea Compare January 31, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants